<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	
	</head>
	<body id="show">
		<script>
			//实现时间的显示功能，
			//要求能显示星期几，年月日，小时分钟秒,并能随着时间的变化而变化。。。
			function run(){
			 var time = new Date();
			 var year = time.getFullYear();
			 var month = time.getMonth()+1;
			 var date= time.getDate();
			 var day = time.getDay();
			 var weeks = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
			 var week = weeks[day];
			 var hour = time.getHours();
			 var minutes = time.getMinutes();
			 var seconds = time.getSeconds();
			 console.log(seconds);
			 if(month<10){
			 month = "0"+month; 
			 }
			 if(date<10){
			 date = "0"+date; 
			 }
			 if(hour<10){
			 hour = "0"+hour; 
			 }
			 if(minutes<10){
			 minutes = "0"+minutes; 
			 }
			 if(seconds<10){
			 seconds = "0"+seconds; 
			 }
			
			 document.getElementById("show").innerHTML = year+"年"+month+"月"+date+"日"+week+hour+":"+minutes+":"+seconds;
			 setTimeout('run()',1000);
			 }
			  
			 run();
		</script>
	</body>
</html>